//
//  SetupAmountVC.swift
//  RPay
//
//  Created by CharlieLiao on 2017/7/25.
//  Copyright © 2017年 Charlie. All rights reserved.
//

/// 设置收款金额
class SetupAmountVC: AmountVC {
    // MARK:  Life Cycle
    override func viewDidLoad() {
        super.viewDidLoad()
        title = LocalStr("设置金额")
        detailLabel.text =  LocalStr("设置金额")
        // Do any additional setup after loading the view.
        if amount > 0 {
            amountTF.text = String(format: "%.2f", amount)
        }
    }
    
    override func tapSumbitBtn()
    {
        let amount = Float(amountTF.text!)
        if amount == nil || amount! <= 0 {
            alert(LocalStr("请设置正确的收款金额"))
        } else {
            if didSetupAmount != nil {
                didSetupAmount!(amount!)
            }
            navigationController!.popViewController(animated: true)
        }
    }
    
    // MARK:  Get
    var amount: Float = 0
    var didSetupAmount: ((_ amount: Float)->Void)?
    
}
